package com.sgb.link.view.adapter;

import android.content.Context;
import android.graphics.Paint;

import androidx.databinding.DataBindingUtil;

import com.sgb.link.R;
import com.sgb.link.databinding.LinkModuleItemPublishFindWorkBinding;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

/**
 * description:工队首页的会员成员,会员和关注的adapter
 * @author younghow
 * @date 2021/9/7
 */
public class TeamMainPageTitleAdapter extends YoungBaseRecycleAdapter<String> {

    public TeamMainPageTitleAdapter(Context context, List<String> datas) {
        super(context, R.layout.link_module_item_publish_find_work, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, String servicesCompanyBean) {
        LinkModuleItemPublishFindWorkBinding binding = DataBindingUtil.bind(holder.itemView);
        if (binding == null) {
            return;
        }
        binding.tvTabName.setText(servicesCompanyBean);
        if (holder.getItem().isSelected()) {
            binding.tvTabName.getPaint().setFlags(Paint.ANTI_ALIAS_FLAG | Paint.FAKE_BOLD_TEXT_FLAG);
            binding.tvTabLine.getPaint().setFlags(Paint.ANTI_ALIAS_FLAG | Paint.FAKE_BOLD_TEXT_FLAG);
        } else {
            binding.tvTabName.getPaint().setFlags(Paint.ANTI_ALIAS_FLAG);
            binding.tvTabLine.getPaint().setFlags(Paint.ANTI_ALIAS_FLAG);
        }
    }
}
